/*
 * @Author: nns4
 * @Date: 2019-10-31 17:29:58
 * @LastEditors: nns4
 * @LastEditTime: 2020-04-24 09:47:23
 * @FilePath: /citciWechartShop/vue.config.js
 * @Description: 
 */
const webpack = require('webpack')
const path = require('path')

const resolve = dir => {
  return path.join(__dirname, dir)
}

const BASE_URL = process.env.NODE_ENV === 'production' ? '/' : '/'

module.exports = {
  publicPath: BASE_URL,
  lintOnSave: false,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('@c', resolve('src/components'))
      .set("@v", resolve('src/views'))
      .set("@api", resolve('src/api'))
      .set("@lib", resolve("src/libs"))
      .end();
  },
  productionSourceMap: false,
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          hack: `true; @import "${path.join(
              __dirname,
              './src/assets/less/vant.less'
            )}";`
        }
      }
    }
  },
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'windows.jQuery': 'jquery'
      })

    ]

  }
}